# Dickstein, Ho, and Mark (2022)
# In order to replicate the analysis, run this file.

# Set to your working directory here: 
LOC="/homedir/tempwrkr/nmark/sharedWork/oregon/replication_package"
# You also need to set the correct working directory at the beginning of the files:
## - library/Preliminaries.R

# 1. Create datasets that will be used in the analysis from the raw data
## Note for this step to run properly, you will need to first create a member level, household level, and plan level dataset from the OHA's APAC database.
cd $LOC/data_construction
bash runme.sh

# 2. Estimate the demand system. 
cd $LOC/analysis/estimationcode
bash RunMe.sh

# 3. Estimate the premium setting equation. 
cd $LOC/analysis/prem_setting
bash runme.sh

# 4. Simulate the counterfactuals. 
cd $LOC/analysis/counterfactuals
bash runme.sh

# 5. Create the relevant tables and figures.
cd $LOC/analysis/tablesandfigures
bash runme.sh